From: IOhannes m zmölnig Date: Mon, 2 Nov 2015 22:51:41 +0000 (+0100) Subject: Added debian/git-tuneclone.sh script X-Git-Tag: archive/raspbian/0.15.4+ds1-1+rpi1^2~187 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=55ca3b66a368058b6bacc377b721ca497ffadc24;p=giada.git Added debian/git-tuneclone.sh script run the script in a freshly checked out repository for fine-tuning --- diff --git a/debian/git-tuneclone.sh b/debian/git-tuneclone.sh new file mode 100755 index 0000000..59ac8c6 --- /dev/null +++ b/debian/git-tuneclone.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +## script to initialize a cloned repository +## with per (local) repository settings. + +# - ignore quilt's .pc/ directory +# - enable the "--follow-tags" mode for pushing + +error() { + echo "$@" 1>&2 +} + +NAME=$(dpkg-parsechangelog -S Source) + +if [ "x${NAME}" = "x" ]; then + error "unable to determine package name" + error "make sure you run this script within a source package dir" + exit 1 +fi + +if [ ! -d ".git" ]; then + error "it seems like this source package is not under git control" + exit 1 +fi + +echo "tuning git-repository for ${NAME}" +git config push.followTags true && echo "enabled push.followTags" + +GITEXCLUDE=".git/info/exclude" +egrep "^/?\.pc/?$" "${GITEXCLUDE}" >/dev/null 2>&1 \ + || (echo "/.pc/" >> "${GITEXCLUDE}" && echo "ignoring /.pc/") + +for branch in pristine-tar upstream master; do + git checkout "${branch}" +done